<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="base-template.imp.xsl" />
	
	<xsl:output encoding="UTF-8" method="html" saxon:character-representation="native" xmlns:saxon="http://saxon.sf.net/"/>
	<xsl:template name="content">
		<xsl:for-each select="//page/Category-list/Category/Category">
			<xsl:choose>
				<xsl:when test="@selected and @title='Автомобили в салоне'">
					<div class="title"><xsl:value-of select="@title" /></div>
				</xsl:when>
				<xsl:when test="@selected and @title='Автомобили на заказ'">
					<div class="title"><xsl:value-of select="@title" /></div>
				</xsl:when>
				<xsl:when test="@selected and @title='Мои объявления'">
					<div class="title"><xsl:value-of select="@title" /></div>
				</xsl:when>
			</xsl:choose>
		</xsl:for-each>
		<xsl:if test="not(//page/Category-list/Category/@selected)">
			<div class="title">Частные объявления</div>
		</xsl:if>

		
		<xsl:for-each select="//page/Cars/Car">
			<!--<xsl:value-of select="@infoid"/>. -->
			<a href="/car/{@infoid}"><div class="title-article"><xsl:value-of select="Model/Developer/@name"/><![CDATA[&nbsp;]]>
			<xsl:value-of select="Model/@name"/></div></a>
			<table>
				<tr>
					<td rowspan="2">
						<a href="/car/{@infoid}"><img src="/media/cars/{@id}/small.jpg" width="114" height="90" alt="{Model/Developer/@name}" border="0"/></a>
					</td>
					<td  class="text">
						<nobr>Цена: <strong><xsl:value-of select="@price"/> <![CDATA[$]]></strong></nobr>
					</td>
				
					<td class="text">
						Год выпуска: <strong><xsl:value-of select="@year"/> г.</strong>
					</td>
				</tr>
				
				<tr>
					<td class="text">Описание: </td>
					<td class="text"><xsl:value-of select="@description"/></td>
				</tr>
			</table>
			<xsl:if test="//page/logined/@status=2">
				<a href="/admin/car/{@infoid}/remove" class="text">Удалить</a> <![CDATA[&nbsp;]]>
				<a href="/admin/car/{@infoid}" class="text">Изменить</a> <![CDATA[&nbsp;]]>
				<!--<a href="/admin/car/{@infoid}/public" class="text">Опубликовать</a> <![CDATA[&nbsp;]]> -->
				<a href="/admin/car/{@infoid}/archive" class="text">В архив</a><br/><br/>
			</xsl:if>
			<xsl:if test="//page/logined/@id=Author/@id and not(//page/logined/@status=2)">
				<a href="/admin/car/{@infoid}" class="text">Изменить</a> <![CDATA[&nbsp;]]>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>	